package com.forekonw.deom1;

/**
 * 数据类型的转化  byte--->short----->int----->long---->float----->double        char---->int
 */

public class DataTypeConvert {
    public static void main(String[] args) {
        byte b = 28;
        int a = b;//自动类型转换
        int c = 123;
        double d = c;//自动类型转换
        System.out.println(a);
        System.out.println(d);

        float f = (float) 3.14;
        double m = 3.1415926;
        int k = (int) m;//强制类型转换
        System.out.println(k);


        int i = 56;
        char j = (char) i;//强制类型转换
        System.out.println(j);


        int l = 5;
        char q = (char) l;//强制类型转换
        System.out.println(q);

    }
}
